package com.winhxd.b2c.common.domain.order.vo;

import com.winhxd.b2c.common.domain.order.model.OrderProductAttribute;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
@ApiModel("订单详情")
public class  OrderDetailVO implements Serializable {
    private Long id;

    private String orderNo;

    private Long skuId;

    private String skuCode;
    @ApiModelProperty("sku图片地址")
    private String skuUrl;
    @ApiModelProperty("商品数量 -退货数量【后台】")
    private Integer number;
    @ApiModelProperty("市场价")
    private BigDecimal marketPrice;

    private Long spuId;
    @ApiModelProperty("spu编码（货号）")
    private String spuCode;
    @ApiModelProperty("spu名称")
    private String spuName;

    private Long brandId;

    private String brandName;
    @ApiModelProperty("折算价")
    private BigDecimal conversionPrice;
    @ApiModelProperty("结算价")
    private BigDecimal otherTotal;
    @ApiModelProperty("状态1 有效 2无效")
    private Integer status;
    @ApiModelProperty("商品属性尺码和颜色2条数据")
    private List<OrderProductAttribute> attributes;
    @ApiModelProperty("商品流转状态")
    private Integer flowStatus;
    @ApiModelProperty("总计 小计的总和")
    private BigDecimal totalMoney = BigDecimal.ZERO;
    @ApiModelProperty("小计 结算价*商品数量")
    private BigDecimal subTotal;

    private Date created;

    private Date updated;

    private String createdBy;

    private String updatedBy;

    @ApiModelProperty(value = "订单商品信息")
    private OrderProductInfoVO orderProductInfoVO;
    @ApiModelProperty(value = "订单商品售后信息")
    private OrderInfoAfterSaleVO orderAfterSale;

    public BigDecimal getSubTotal() {
        return this.otherTotal.multiply(BigDecimal.valueOf(this.number));
    }

    public void setSubTotal(BigDecimal subTotal) {
        this.subTotal = subTotal;
    }
}